
package com.ebupt.migu.songlist.enums;
import lombok.Getter;


/**
 * 行为枚举
 * @author tz
 */
@Getter
public enum ActionEnum {

	/**
	 * 试听
	 */
	AUDITION(1, "试听"),
	/**
	 * 收藏
	 */
	COLLECT(2, "收藏"),
	/**
	 * 下载
	 */
	DOWNLOAD(3, "下载"),
	/**
	 * 分享
	 */
	SHARE(4, "分享"),
	/**
	 * 评论
	 */
	COMMENT(5, "评论"),
	/**
	 * 曝光
	 */
	EXPOSURE(6, "曝光"),
	/**
	 * 访问
	 */
	VISIT(7, "访问");

	private Integer code;
	private String name;

	ActionEnum(int code, String name){
		this.code = code;
		this.name = name;
	}

	public static String getNameByCode(int code){
		for (ActionEnum v: values()) {
			if(v.getCode()==code){
				return v.getName();
			}
		}
		return null;
	}
}
